package com.action;

import com.alibaba.fastjson.JSONArray;
import com.bean.ResponseBean;
import com.pojo.InputPrograme;
import com.service.InputProgrameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/input")
public class InputProgrameAction {

    @Autowired
    private InputProgrameService inputProgrameService;

    /**
     * 获取所有节目列表
     * @return
     */
    @RequestMapping("/getAll")
    public ResponseBean  getAll()
    {
        List list = inputProgrameService.getAll();
        return new ResponseBean(0,"获取成功",list);
    }

    /**
     * 批量移动
     * @param data
     * @param direction
     * @return
     */
    @RequestMapping("/batchMove")
    public ResponseBean batchMove(@RequestBody String data,@RequestParam String direction)
    {
        List list = inputProgrameService.batchMove(data,direction);

        return new ResponseBean(0,"获取成功",list);
    }

}
